﻿using System;
using System.Collections.Generic;
using System.Text;
using EmailJabber.Logic.Commands.Base;

namespace EmailJabber.EmailJabber.Core.Commands.Common
{
    public class CommandManager
    {
        static CommandManager instance = new CommandManager();

        public static CommandManager Instance
        {
            get { return instance; }
        }

        CommandManager()
        {

        }

        private Dictionary<Guid, CommandBase> _commands = new Dictionary<Guid, CommandBase>();

        public Guid Register(CommandBase command)
        {
            _commands[command.Id] = command;
            return command.Id ;
        }

        public CommandBase GetCommand(Guid commandId)
        {
            return _commands[commandId];
        }
    }
}